<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>{$meta_title}</h2>
    </div>
    <div class="cf">
        <div class="fl">

            <a class="btn" href="{:U('create')}">新 增</a>
            <button class="btn ajax-post" target-form="ids" url="{:U('setStatus',array('status'=>1))}">启 用</button>
            <button class="btn ajax-post" target-form="ids" url="{:U('setStatus',array('status'=>0))}">禁 用</button>
            <button class="btn ajax-post confirm" target-form="ids" url="{:U('setStatus',array('status'=>-1))}">批量删除</button>
        </div>

        <!-- 数据表格 -->
        <div class="data-table">
            <table class="">
                <thead>
                <tr>
                    <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
                    <th>排序</th>
                    <th>标题</th>
                    <th>说明</th>
                    <th>类型</th>
                    <th>图标</th>
                    <th>创建时间</th>
                    <th>更新时间</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <volist name="_list" id="vo">
                    <tr>
                        <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.id}" /></td>
                        <td>{$vo.sort}</td>
                        <td>{$vo.title}</td>
                        <td>{$vo.description}</td>
                        <td><eq name="vo['type']" value="2">图标<else />文本</eq></td>
                        <td><img src="{$vo.pic_id|get_cover='path'}" style="max-width: 100px" alt="{$vo.title}"/></td>
                        <td>{$vo.create_time}</td>
                        <td>{$vo.update_time}</td>
                        <td>{$vo.status_text}</td>
                        <td>
                            <a href="{:U('edit?id='.$vo['id'])}">编辑</a>
                            <a href="{:U('setStatus?ids='.$vo['id'].'&status='.abs(1-$vo['status']))}" class="ajax-get">{$vo.status|show_status_op}</a>
                            <eq name="status" value="1"><a href="{:U('setStatus?status=-1&ids='.$vo['id'])}" class="confirm ajax-get">删除</a></eq>
                        </td>
                    </tr>
                </volist>
                </tbody>
            </table>


        </div>

        <!-- 分页 -->
        <div class="page">
            {$_page}
        </div>

</block>

<!-- 加载底部JS -->
<block name="script">
    <include file="Public/footjs" />
</block>